﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PBOfficeMaster.master" AutoEventWireup="true"
    CodeFile="NewsManager.aspx.cs" Inherits="NewsManager_NewsManager" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .branchtop
        {
            margin: 10px 50px;
            text-align: left;
            font-size: 12px;
        }
        .lbBranch
        {
            font-size: 14px;
            font-weight: bold;
            background-image: url('../imges/daohangbeijing1.jpg');
            background-repeat: no-repeat;
            text-align: center;
            margin: 0;
            color: White;
            padding-top: 7px;
            height: 22px;
            width: 110px;
        }
        .btnBranch
        {
            width: auto;
            height: 20px;
            background-color: #ccffff;
            border: 1px solid #000099;
            color: #000099;
        }
        hr
        {
            height: 1px;
            margin-left: 45px;
            color: Blue;
            width: 804px;
        }
        .txt
        {
            border: 1px solid #6699FF;
            color: Blue;
        }
        .grid
        {
            text-align: center;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="width: 864px; font-size: 14px;">
        <div class="branchtop">
            <table>
                <tr>
                    <td>
                        当前位置
                    </td>
                    <td>
                        <div class="lbBranch">
                            新闻管理</div>
                    </td>
                </tr>
            </table>
        </div>
        <hr />
        <div style="text-align: left; margin: 7px 100px; width: 740px; height: 30px; border: 1px solid #ccc;
            padding-left: 8px;">
            新闻类型：<asp:DropDownList ID="ddlNewsType" runat="server" DataTextField="TypeName" Height="20px"
                Width="116px">
            </asp:DropDownList>
            &nbsp;&nbsp;
            <asp:Button ID="btnCheck" CssClass="btnBranch" runat="server" Text="查询" OnClick="btnCheck_Click" />
        </div>
        <div style="text-align: right; margin: 7px 100px; width: 740px;">
            <a href="AddNews.aspx">添加新闻</a></div>
        <div style="text-align: left; margin: 7px 100px;">
            <asp:GridView ID="GridView1" runat="server" Width="740px" BorderColor="#009999" 
                AutoGenerateColumns="False" DataKeyNames="NewsId" 
                onrowcommand="GridView1_RowCommand" onrowdeleting="GridView1_RowDeleting">
                <AlternatingRowStyle BackColor="#CCFFCC" />
                <Columns>
                    <asp:BoundField DataField="NewsId" HeaderText="消息ID" />
                    <asp:BoundField DataField="NewsTitle" HeaderText="标题" />
                    <asp:TemplateField HeaderText="类型">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("NewsType.TypeName") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("NewsType.TypeName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="IsTop" HeaderText="是否置顶" />
                    <asp:BoundField DataField="IsCommend" HeaderText="是否推荐" />
                    <asp:TemplateField HeaderText="修改新闻">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:ImageButton ID="ImageButton1" runat="server" CommandName="modify" ImageUrl="~/imges/modify.png" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="删除新闻">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:ImageButton ID="ImageButton2" runat="server" CommandName="delete" ImageUrl="~/imges/delete.png" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <HeaderStyle BackColor="#66CCFD" CssClass="grid" ForeColor="White" Height="25px" />
                <RowStyle CssClass="grid" />
            </asp:GridView>
        </div>
    </div>
</asp:Content>
